using Game.Networking.Client;
using MemoryPack;
using UnityEngine;

namespace Game.Networking {
	public sealed class S_SyncPositionMessageHandler : BaseServerMessageHandler {

		public override ServerPacketID CommandId {
			get {
				return ServerPacketID.UpdateEntityPos;
			}
		}

		public override void ProcessMessage(byte[] rawCommand) {
			var command = MemoryPackSerializer.Deserialize<S_SyncPositionMessage>(rawCommand);
			ClientEntityController.Instance.UpdatePosition(command.ID, command.Position, Vector3.zero, true, false);
		}
	}
}
